package tools.genomeMatrix;

import java.util.HashMap;


public class gene implements Comparable<gene>{

	private String id,chr;
	private int start,end;
	private HashMap<String, Integer> count;
//	private HashMap<String, FastaSeq> gDNA;
	
	public gene(String id, String chr, int start, int end) {
		super();
		this.id = id;
		this.chr = chr;
		this.start = start;
		this.end = end;
		count= new HashMap<String, Integer>();
//		gDNA= new HashMap<String, FastaSeq>();
	}

	public String getId() {
		return id;
	}

	public String getChr() {
		return chr;
	}

	public int getStart() {
		return start;
	}

	public int getEnd() {
		return end;
	}

	public int compareTo(gene g2){
		return this.getStart()- g2.getStart();
	}
	
	public void add(String nuc){
		if(count.containsKey(nuc)){
			count.put(nuc, count.get(nuc)+1);
		}else{
			count.put(nuc, 1);
		}
	}
	

	
	public void print(String[] nucs,int nrOfStrains){
//		String result="";
		for(int i=1;i<=nrOfStrains;i++){
			for (String nuc : nucs) {
				if(count.containsKey(nuc+i)){
					System.out.println(this.getId()+"\t"+i+"\t"+nuc+"\t"+count.get(nuc+i));
				}
			}
		}
	}
	
}
